# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=utfcpp
pkgver=4.0.5
pkgrel=0
pkgdesc="UTF-8 with C++ in a portable way"
url="https://github.com/nemtrif/utfcpp"
arch="noarch"
license="BSL-1.0"
makedepends="cmake"
source="$pkgname-$pkgver.tar.gz::https://github.com/nemtrif/utfcpp/archive/v$pkgver.tar.gz
	0001-fix-cmake-dir.patch
	"
options="!check" # problems with gtest

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=1 ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
49ca33bfb2ee44515f555184b51191f7b706a228fb84ddc62e1e6b59c7d69a5ff836f38694daad0012a0f651b6199451974fe44ebe80081df00cf8c2759e3249  utfcpp-4.0.5.tar.gz
4df2fbee0803137544127cefbef4c0edbcd0772de604bcdfbb9f13a802ab36106276842cdbb3f2df4677a87080274dad3380143f7c3a0da9d10eb7ea3a4014a6  0001-fix-cmake-dir.patch
"
